package design.mode.effective_java.chapter3.item10;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author ZhongMingde on 2021/8/11
 */

public class CounterPoint extends Point{
    private static final AtomicInteger counter = new AtomicInteger();

    public CounterPoint(int x, int y) {
        super(x, y);
        counter.incrementAndGet();
    }

    public static int numberCreated(){
        return counter.get();
    }
}


